<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪类选择器</title>
    <style>
        /*.top:only-child {
            background-color: blueviolet;
        }
        
        ul li:first-child {
            background-color: teal;
        }
        
        ul li:last-child {
            background-color: pink;
        }*/
        
        ul li:nth-last-child(2) {
            background-color: aqua;
        }
        
        .top:hover {
            background-color: red;
            color: #fff;
            cursor: pointer;
        }
        
        .baidu:hover {
            background-color: red;
        }
        
        .input:focus {
            background-color: red;
        }
        
        .line::before {
            content: 'hello world';
            display: block;
        }
        
        .content::selection {
            color: red;
        }
    </style>
</head>

<body>
    <div class="top">
        <p>独生子</p>
        <h1>独生子</h1>
    </div>

    <ul>
        <li>html</li>
        <li>css</li>
        <li>js</li>
        <li>js</li>
        <li>js</li>
        <li>js</li>
        <li>js</li>
        <li>js</li>
    </ul>

    <a class="baidu" href="#">百度</a>

    <input type="text" class="input">

    <div class="line">--------------------------</div>

    <div class="content">推荐使用 npm 的方式安装，它能更好地和 webpack 打包工具配合使用。</div>
</body>

</html>